package edu.ecu.seng6270.goa.ropa;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import net.miginfocom.swing.MigLayout;

/**
 * GUI Panel to prompt user for a choice of order types
 */
public class OrderTypePanel extends JPanel {

	private static final long serialVersionUID = 7650337406645890197L;
	ROPAMain parent;

	public OrderTypePanel(final ROPAMain ropaMain) {
		super();
		
		this.parent = ropaMain;
		
		//////////////////////////////////////
		//			OrderType Panel			//
		//////////////////////////////////////
		this.setBackground(new Color(255, 255, 255));
		
		this.setLayout(new MigLayout("", "[grow]", "[grow][][][][]"));
		
		JLabel lblWelcomeBackYour = new JLabel("Welcome Back!");
		lblWelcomeBackYour.setFont(new Font("Tahoma", Font.BOLD, 18));
		lblWelcomeBackYour.setHorizontalAlignment(SwingConstants.CENTER);
		this.add(lblWelcomeBackYour, "cell 0 0,growx");
		
		JLabel lblYourAccountContains = new JLabel("Your account contains 1 photo.  Would you like to order reprints?");
		lblYourAccountContains.setFont(new Font("Tahoma", Font.BOLD, 14));
		this.add(lblYourAccountContains, "cell 0 1,alignx center");
		
		JButton btnNewButton = new JButton("Express Reprints");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				parent.moveToCard("expressOrderPanel");
			}
		});
		this.add(btnNewButton, "flowx,cell 0 2,alignx center");
		
		JLabel lblExpressOrdersAre = new JLabel("Express orders are our easiest, least expensive option!");
		lblExpressOrdersAre.setHorizontalAlignment(SwingConstants.LEFT);
		this.add(lblExpressOrdersAre, "cell 0 2");
		
		JButton btnCustomReprints = new JButton("Custom Reprints");
		btnCustomReprints.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				parent.moveToCard("customOrderPanel");
			}
		});
		this.add(btnCustomReprints, "flowx,cell 0 3,alignx center");
		
		JLabel lblCustomOrdersProvide = new JLabel("Custom orders provide maximum flexibility!");
		this.add(lblCustomOrdersProvide, "cell 0 3");
		
		JButton btnLogout = new JButton("Logout");
		btnLogout.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				parent.moveToCard("loginPanel");
			}
		});
		this.add(btnLogout, "cell 0 4,alignx center");

		
	}
	
}
